﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ddcCajamarca.BusinessEntities.Directorio;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;

namespace ddcCajamarca.Repository.Mapping
{
    public class ActividadMap : EntityTypeConfiguration<Actividad>
    {
        public ActividadMap()
        {
            this.HasKey(c => c.Id);

            this.Property(c => c.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(c => c.Nombre)
                .HasMaxLength(50)
                .IsRequired();

            this.Property(c => c.Comentario)
                .HasMaxLength(120)
                .IsOptional();

            this.ToTable("Actividad");
            this.Property(c => c.Id).HasColumnName("Id");
            this.Property(c => c.Nombre).HasColumnName("Nombre");
            this.Property(c => c.Comentario).HasColumnName("Comentario");
        }
    }
}
